colour_recoveryfandomcom-20200213-history
How colour recovery works
This page describes the method of operation of Richard Russell's Colour Recovery process. When a PAL-coded colour signal is viewed as a composite signal (for example on a monochrome television monitor) the chrominance appears as a fine pattern of diagonal stripes at a characteristic angle or angles, related to the frequency of the colour subcarrier. Because the source of the film-recorded material will have been a professional PAL encoder, we can be certain that the relationship between the original TV line frequency (15,625 Hz) and the PAL subcarrier frequency (4.43361875 MHz) will have been absolutely precise, thus guaranteeing consistent patterns of stripes. Although deficiencies of the film-recording process and other defects distort the exact relationship between positions in the frame and points on the original PAL waveform, the general appearance of the diagonal chrominance stripes will remain. They may not be at precisely the right pitch or the right angle, but they should be approximately correct. Hence, as a first step, it is possible to extract the chrominance content of the film-recorded signal by using a two-dimensional filter which passes only diagonal patterns with approximately the correct pitch and angle. Although some luminance will inevitably pass through the filter, this is no different in principle from the problem of cross colour in a conventional PAL decoder. In fact we can do more. Because of the way the PAL signal is defined, the U''' component (corresponding to the Blue–Luminance colour-difference signal) and the '''V component (corresponding to the Red–Luminance colour-difference signal) appear as stripes which slope in different directions. Hence we can separate the U and V components simply by examining the angle of the stripes: U chrominance (left) V chrominance (right) Thus we have managed not only to separate the chrominance from the luminance, but also to separate the U chroma from the V chroma, in a way which is not unduly sensitive to the geometric distortions and other imperfections in the film-recorded material. Although only part of the solution, this is a major achievement. The amplitudes of the U and V components can now be measured directly, but their signs (i.e. whether positive or negative) cannot be determined in a simple way. This can easily be seen by considering that reversing the sign of U or V, that is a 180° phase shift, is indistinguishable from a position displacement equal to half a cycle of subcarrier, and displacements of this magnitude or greater are very likely to have taken place because of the various geometric distortions. To determine the signs of U and V there is no alternative but to attempt to measure and compensate for the geometric distortions. However since we now only have to derive two bits of information (the signs of U and V) for each pixel we have a better chance than had we tried to recover the entire chrominance by this means. In addition, we can assume that the signs of U and V do not change over small distances so we can take advantage of averaging over quite a large number of pixels to make the process more rugged. Accordingly the film-recorded frame is divided into a set of rectangular blocks (in practice a grid of 120 blocks horizontally by 90 blocks vertically is used) and the signs of U and V determined for each block rather than for each pixel. The geometric distortion is measured in two steps, firstly the vertical component (i.e. by how much each block of the film-recorded image is displaced from its theoretical position in the vertical direction) and secondly the horizontal component (the displacement of each block in the horizontal direction). Since the chrominance patterning consists of diagonal lines it is not obvious at first sight how it is possible to measure the horizontal and vertical displacements independently. However a closer look at the detailed patterns shows that there are in fact two diagonal components in each one, for example the U chrominance consists of a broad set of stripes sloping downwards to the right at a relatively steep angle, and a narrow set of stripes sloping downwards to the left at a relatively shallow angle. Technically these two components have vertical frequencies of 72 cycles-per-active-picture-height and 216 cycles-per-active-picture-height respectively. The presence of the two different diagonal components permits measurement of the vertical displacement independently of the horizontal displacement. The way this is achieved is to extract the 72 c/aph and 216 c/aph components (using vertical bandpass filters centred on these two frequencies) and to mix them together (mathematically this is achieved by multiplication) to generate sum and difference signals. The resulting 288 c/aph sum signal has a horizontal frequency of zero, that is it consists of horizontal stripes. Usefully, it so happens that the same pattern is produced even if there is a mixture of U and V components (which typically there will be) and whether the signs of U and V are positive or negative - these characteristics effectively 'cancel out' in the multiplication process! 288 c/aph pattern Unfortunately we cannot measure the absolute vertical displacement of a block by examining this pattern (since a displacement of any multiple of one-288th of the picture height results in an identical pattern); we can only measure it relative to the nearest cycle of this vertical frequency. However this limitation isn't as serious as it might seem, because we can assume that the vertical displacement only changes relatively slowly compared to the size of a block. By comparing the measured displacements for adjacent blocks, and assuming the absolute displacement does not vary much between them, we can disambiguate the relative measurements so that each relates to all the others in an absolute way. The measurements are still relative in a global sense, but we can deal with that issue later. Having measured the vertical component of the geometric distortion for each block we can set about measuring the horizontal component. To do that we can simply look at the diagonal chrominance pattern, because knowing the vertical displacement we can work out what horizontal displacement would give rise to a pattern in that position. Unfortunately we are not as fortunate as we were with the vertical measurements, because we need to look at the U and V components separately, and the signs now are important. However this is not a major complication: we have already separated the U and V components, and the measurement can be made independent of the signs by examining the absolute value of the chrominance. As with the vertical measurement, we cannot derive an absolute horizontal displacement, only one relative to the nearest half-cycle of PAL subcarrier (not a full cycle, because we used the absolute value of the chrominance). However, we can use exactly the same disambiguation trick as we did for the vertical measurement to derive a set of horizontal displacements that relate to each other in an absolute way, despite being relative in a global sense. Knowing the vertical and horizontal displacements of each block from its 'true' position in the frame it is possible to generate reference subcarriers (one for U and one for V) with the correct phases to demodulate the chrominance signals in that block. Unlike conventional PAL decoding, in which the reference subcarriers are simple one-dimensional signals, in this case they are two-dimensional signals to match the two-dimensional nature of the chrominance. Since all we need to discover are the signs of U and V the regenerated subcarrier doesn't need to be particularly accurate. The demodulation process consists of multiplying each chrominance component (U and V) with its reference subcarrier and summing the result over all pixels in the block. If the sum is positive then the sign of the chrominance is positive; if the sum is negative the sign of the chrominance is negative. But what about the fact that the vertical and horizontal displacements were measured only relative to the nearest 1/288 c/aph and half-cycle of subcarrier respectively? The consequence is that we don't know the absolute signs of the chrominance, but the signs are consistent across the entire image. In fact we are no worse off than we otherwise would have been, because in the absence of a colour burst, it would have been impossible to determine the true signs of U and V even if the absolute displacements had been known! Thus there are four possibilities: * The signs of U and V are all correct. * The sign of U in all the blocks needs to be inverted. * The sign of V in all the blocks needs to be inverted. * The signs of both U and V in all the blocks need to be inverted. Determining which of these is the case can only be done by the user, based on there being something in the frame whose true colour is known (typically flesh tones). However, once determined for one frame it is often possible to infer the correct signs on subsequent, similar, frames. Knowing the amplitudes of the U and V components by direct measurement, and their signs from the above process, we can generate the baseband colour-difference signals and recreate a full-colour picture!